package com.clpms.bean.enumBean;

/**
 * @author caixinyong
 * @date 2023/5/12 3:17 PM
 */

public enum LearnRecordProgress {
	WEI_ZHI(0, "未知"),
	WEI_KAI_SHI(1, "未开始"),
	JIN_XING_ZHONG(2, "进行中"),
	YI_TI_JIAO(3, "已提交"),
	YI_GUO_QI(4, "已过期"),

	;


	private final Integer code;
	private final String desc;


	public Integer getCode() {
		return this.code;
	}

	public String getDesc() {
		return this.desc;
	}

	private LearnRecordProgress(Integer code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public static Integer getCodeByDesc(String desc) {
		for (LearnRecordProgress status : LearnRecordProgress.values()) {
			if (status.getDesc().equals(desc)) {
				return status.getCode();
			}
		}
		return 0;
	}
}
